function transformNum(value) {
  if (isNaN(value)) {
    return null;
  }
  return value * 1;
}
export default {
  created() {
    if (this.item && this.item.vdNumMin !== undefined) {
      var label = this.item.getLabel();
      this.$emit("componentNotify", "addRule", {
        field: this.item.name,
        rules: [
          {
            type: "number",
            required: true,
            transform: transformNum,
            message: "请填写" + label + "，必须为数字"
          },
          {
            type: "number",
            min: this.item.vdNumMin,
            message: label + "必须大于" + this.item.vdNumMin
          }
        ]
      });
    }
  }
};
